package com.example.tongue.ui.FragmentPageAdapterButtom;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;


import com.example.tongue.main.BottomNavDemo;
import com.example.tongue.ui.Online.OnlinePhysicianFragment;
import com.example.tongue.ui.Personal.PersonalFragment;
import com.example.tongue.ui.Seetongue.SeetongueFragment;

public class FragmentPageAdapterBottom extends FragmentPagerAdapter {
    private static final int FragmentPage_Count = 3;
    private SeetongueFragment seetongueFragment;
    private OnlinePhysicianFragment onlinePhysicianFragment;
    private PersonalFragment personalFragment;

    public FragmentPageAdapterBottom(FragmentManager fm) {
        super(fm);
        seetongueFragment=new SeetongueFragment();
        onlinePhysicianFragment=new OnlinePhysicianFragment();
        personalFragment=new PersonalFragment();

    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment=null;

        switch (position){
            case BottomNavDemo.tongueImageRecognitionPage:{
                fragment= seetongueFragment;
            }break;

            case BottomNavDemo.onlinePhysicianPage:{
                fragment= onlinePhysicianFragment;
            }
            break;
            case BottomNavDemo.personalPage:{
                fragment=   personalFragment;
            }
            break;

        }
        return fragment;

    }

    @Override
    public int getCount() {
        return FragmentPage_Count;
    }
}
